<template>
  <el-tabs v-model="activeName" class="tabs" type="card" v-on="$listeners">
    <el-tab-pane
      v-for="item in list"
      :key="item.value"
      :value="item.value"
      :label="item.label"
    />
  </el-tabs>
</template>
<script>
export default {
  props: ['tabList'],
  data() {
    return {
      activeName: '1',
      list: []
    }
  },
  watch: {
    tabList: {
      handler(data) {
        if (data.length) {
          this.activeName = data[0].value
          this.list = data
        }
      },
      immediate: true
    }
  },
  methods: {
    // handleClick() {
    //     this.$emit('tab-click')
    // }
  }
}
</script>
<style scoped lang="scss">
::v-deep {
  .tabs.el-tabs--card > .el-tabs__header .el-tabs__item {
    background-color: #eee;
    border: none;
    margin-right: 5px;
  }
  .tabs.el-tabs--card > .el-tabs__header .el-tabs__item.is-active {
    background-color: #fff;
  }
  .tabs.el-tabs--card > .el-tabs__header .el-tabs__nav {
    border-radius: 0;
    border: none;
  }
  .tabs.el-tabs--card .el-tabs__header {
    margin: 0;
  }
  .tabs.el-tabs--card > .el-tabs__header {
    border-bottom: 0;
  }
}
</style>
